﻿//New
function VoteIns() {
    var aaa = $("#aaa").val();

    var dataPrams = "method=new";
    dataPrams = dataPrams + "&aaa=" + aaa;
    dataPrams = dataPrams + "&i=" + Math.random();

    $.ajax({
        type: "post",
        dataType: "json",
        url: "/Server/HVote.ashx",
        data: dataPrams,
        success: function (data) {
            ret = data;
            //{"code":-1,"message":"","attach":null,"success":false}
            if (ret.success) {
                alert("成功！");
                //parent.hs.close();
                //top.location.reload();
                location.reload();
            }
            else {
                alert(ret.message);
                return;
            }
        }
    });
}


//Update
function VoteUpdate() {
    var aaa = $("#aaa").val();

    var dataPrams = "method=update";
    dataPrams = dataPrams + "&aaa=" + aaa;
    dataPrams = dataPrams + "&i=" + Math.random();

    $.ajax({
        type: "post",
        dataType: "json",
        url: "/Server/HVote.ashx",
        data: dataPrams,
        success: function (data) {
            ret = data;
            //{"code":-1,"message":"","attach":null,"success":false}
            if (ret.success) {
                alert("成功！");
                //parent.hs.close();
                //top.location.reload();
                location.reload();
            }
            else {
                alert(ret.message);
                return;
            }
        }
    });

}


//Del
function VoteDel() {
    var aaa = $("#aaa").val();

    var dataPrams = "method=del";
    dataPrams = dataPrams + "&aaa=" + aaa;
    dataPrams = dataPrams + "&i=" + Math.random();

    $.ajax({
        type: "post",
        dataType: "json",
        url: "/Server/HVote.ashx",
        data: dataPrams,
        success: function (data) {
            ret = data;
            //{"code":-1,"message":"","attach":null,"success":false}
            if (ret.success) {
                alert("成功！");
                //parent.hs.close();
                //top.location.reload();
                location.reload();
            }
            else {
                alert(ret.message);
                return;
            }
        }
    });

}
